package com.darren.euc.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonFormat;

@Entity
@Table(name = "euc_meetingroom")
public class Meetingroom implements Serializable {
	
	private static final long serialVersionUID = 4134285022641109377L;

	@Id
	@Column(name = "id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	
	@Column(name = "meetingroom_name",nullable=true,columnDefinition="varchar",length=255)
	private String meetingroomName;	
	
//	@ManyToOne(targetEntity = Province.class, fetch = FetchType.EAGER)
//	@JoinColumn(name = "meetingroom_status_id", referencedColumnName = "id") 
//	private MeetingroomStatus meetingroomStatus;
	
	@Column(name = "meetingroom_status",columnDefinition="varchar",length=50)
	private String meetingroomStatus;

	@Column(name = "meetingroom_area",columnDefinition="varchar",length=20)
	private String meetingroomArea;
	
	@Column(name = "seat_count",columnDefinition="varchar",length=50)
	private String seatCount;	
	
	@Column(name = "display_picture",columnDefinition="varchar",length=255)
	private String displayPicture;
	
	@Column(name = "meetingroom_price",columnDefinition="decimal(15,2)")
	private Double meetingroomPrice = 0D;	
	
	@Column(name = "book_start_time",columnDefinition="varchar",length=24)
	private String bookStartTime;
	
	@Column(name = "book_end_time",nullable=true,columnDefinition="varchar",length=24)
	private String bookEndTime;
	
	@Column(name = "other_facilities",nullable=true,columnDefinition="varchar",length=255)
	private String otherFacilities;
	
	@ManyToOne(targetEntity = Province.class, fetch = FetchType.EAGER)
	@JoinColumn(name = "province_id", referencedColumnName = "province_id") 
	private Province province;	

	@ManyToOne(targetEntity = City.class, fetch = FetchType.EAGER)
	@JoinColumn(name = "city_id", referencedColumnName = "city_id") 
	private City city;
	
//	@ManyToOne(targetEntity = Space.class, fetch = FetchType.EAGER)
//	@JoinColumn(name = "space_id", referencedColumnName = "id") 
//	private Space space;
	
	@ManyToOne
	@JoinColumn(name="space_id", referencedColumnName = "id") 
	@Basic(fetch=FetchType.LAZY)
	private Space space;
	
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	@Column(name = "create_time",nullable=true,columnDefinition="datetime")
	private Date createTime;

	@ManyToOne(targetEntity = User.class, fetch = FetchType.EAGER)
	@JoinColumn(name = "create_user_id", referencedColumnName = "user_id") 
	private User createUser;
	
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	@Column(name = "last_modify_time",nullable=true,columnDefinition="datetime")
	private Date lastModifyTime;
	
	@ManyToOne(targetEntity = User.class, fetch = FetchType.EAGER)
	@JoinColumn(name = "last_modify_user_id", referencedColumnName = "user_id") 
	private User lastModifyUser;
	
	@Column(name = "price_unit")
	private String priceUnit = "元/30分钟";
	
	@Column(name = "enable",nullable=false)
	private boolean enable = true;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getMeetingroomName() {
		return meetingroomName;
	}

	public void setMeetingroomName(String meetingroomName) {
		this.meetingroomName = meetingroomName;
	}

	public String getMeetingroomStatus() {
		return meetingroomStatus;
	}

	public void setMeetingroomStatus(String meetingroomStatus) {
		this.meetingroomStatus = meetingroomStatus;
	}

	public String getMeetingroomArea() {
		return meetingroomArea;
	}

	public void setMeetingroomArea(String meetingroomArea) {
		this.meetingroomArea = meetingroomArea;
	}

	public String getSeatCount() {
		return seatCount;
	}

	public void setSeatCount(String seatCount) {
		this.seatCount = seatCount;
	}

	public String getDisplayPicture() {
		return displayPicture;
	}

	public void setDisplayPicture(String displayPicture) {
		this.displayPicture = displayPicture;
	}

	public Double getMeetingroomPrice() {
		return meetingroomPrice;
	}

	public void setMeetingroomPrice(Double meetingroomPrice) {
		this.meetingroomPrice = meetingroomPrice;
	}

	public String getBookStartTime() {
		return bookStartTime;
	}

	public void setBookStartTime(String bookStartTime) {
		this.bookStartTime = bookStartTime;
	}

	public String getBookEndTime() {
		return bookEndTime;
	}

	public void setBookEndTime(String bookEndTime) {
		this.bookEndTime = bookEndTime;
	}

	public String getOtherFacilities() {
		return otherFacilities;
	}

	public void setOtherFacilities(String otherFacilities) {
		this.otherFacilities = otherFacilities;
	}

	public Province getProvince() {
		return province;
	}

	public void setProvince(Province province) {
		this.province = province;
	}

	public City getCity() {
		return city;
	}

	public void setCity(City city) {
		this.city = city;
	}

	public Space getSpace() {
		return space;
	}

	public void setSpace(Space space) {
		this.space = space;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public User getCreateUser() {
		return createUser;
	}

	public void setCreateUser(User createUser) {
		this.createUser = createUser;
	}

	public Date getLastModifyTime() {
		return lastModifyTime;
	}

	public void setLastModifyTime(Date lastModifyTime) {
		this.lastModifyTime = lastModifyTime;
	}

	public User getLastModifyUser() {
		return lastModifyUser;
	}

	public void setLastModifyUser(User lastModifyUser) {
		this.lastModifyUser = lastModifyUser;
	}

	public String getUnit() {
		return priceUnit;
	}

	public void setUnit(String priceUnit) {
		this.priceUnit = priceUnit;
	}

	public boolean isEnable() {
		return enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}

}
